package com.example.frickytest;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.content.Context;
import android.content.Intent;

public class DispActivity extends Activity {
	private final int WC = ViewGroup.LayoutParams.WRAP_CONTENT;
	public static final int EXIT_ID = Menu.FIRST + 2;
	private TextView tx;
	private Context context;
	private Intent intent;
	
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setTitle("Second Screen");
		intent = this.getIntent();
		tx = new TextView(this);
		tx.setText("Here Is Your Map.");
		setContentView(tx, new LinearLayout.LayoutParams(WC, WC));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		menu.add(0, EXIT_ID, 0, "Exit");
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case EXIT_ID:
			//((ThreadActivity)context).setTitle("ThreadActivity");
            setResult(RESULT_OK, intent);
			this.finish();
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}